<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>vue</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <style>
        #root {
            width: 500px;
            margin: 200px auto;
            text-align: center;
        }

    </style>
</head>

<body>
    <div id="root">
        <h2>vue3已经移除该特性</h2>
        <span>{{new Date().getTime() | timeFormater}}</span>
    </div>
    <script>
        Vue.config.productionTip = false
        const vm = new Vue({
            el: '#root',
            data: {
                now: 1639970352645,
            },
            computed: {},
            watch: {},
            methods: {},
            filters: {
                timeFormater(val) {
                    console.log(val);
                    return String(val).slice(0, 10)
                }
                // 过滤器没啥用，v3已经移除了这一属性
                // 可以设置全局过滤器，所有的vue实例都能使用
            }
        })
    </script>
</body>

</html>
